﻿using MongoDB.Bson;
using Project.Core.Common;
using Project.Core.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Project.Core.IServices.Base
{
    public interface BaseIService<T> where T : BaseModel, new()
    {
        Task<int> Add(T Entity);
        Task<bool> Delete(T Entity);
        Task<bool> Delete(int Id);
        Task<List<T>> Query(Expression<Func<T, bool>> expression);
        Task<PageDataList<T>> QueryByCondition(Expression<Func<T, bool>> expression, bool IsPage, int PageIndex, int PageSize, Expression<Func<T, object>> orderExpression, bool isAsc);
        Task<bool> Update(T Entity);
        Task<T> Find(Expression<Func<T, bool>> expression);
    }
    
}
